<template>
	<view style="position: relative;">
		<view class="nav">
			<headerNav :navData="navData" :show="false" :width="50" @click='click' />
		</view>
		<view class="center">
			
		</view>
		<first v-if="index===0" :myInfo="detail.cadre_excel" :photo="detail.photo"></first>
		<last v-else :myInfo="detail.personnel_excel" :photo="detail.photo"></last>
	</view>
</template>

<script>
	import headerNav from "@/components/nav/nav.vue";
	import first from "@/components/appoint/first.vue";
	import last from "@/components/appoint/last.vue";
	import {
		Supervision
	} from '@/api/index.js';
	export default {

		components: {
			headerNav,
			first,
			last
		},
		data() {
			return {
				id: '',
				index: 0,
				navData: [{
					title: "干部任免审批表",
					id: 1312
				}, {
					title: "廉政鉴定表",
					id: 432
				}],
				detail: {
				}
			};
		},
		methods: {
			click(i) {
				console.log('1', i)
				this.index = i
			},
			async init() {
				const res = await Supervision.getRecordDetail(this.id)
				this.detail = res.data
				console.log(res)
			},
		},
		async onLoad(res) {
			this.id = res.id
			console.log(res)
			 await this.init()
		}
	}
</script>

<style lang="scss" scoped>
	.nav {
		width: 750rpx;
		background-color: #FFFFFF;
		padding: 10rpx 0;
		padding-top: 30rpx;
		position: fixed;
		top: 0;
		z-index: 999;
	}
	.center{
		box-sizing: border-box;
		margin-top: 100rpx;
	}
</style>
